{template header.html}

{template breadcrumb.html}

<div class="container mainbody">
    <div class="article-container">
        <h2 class="article-title">{$title}</h2>
        <div class="article-meta">
            <span>发布时间：{function.date("Y-m-d H:i:s", $create_time)}</span>
            <span>最后更新：{function.date("Y-m-d H:i:s", $time)}&nbsp;</span>
            <span>阅读量：<script type="text/javascript" src="{function.url('api/index/hits',array('id'=>$id))}"></script>次&nbsp;</span>
            <span>{if $originalurl}&nbsp;<a href="{$originalurl}" target="_blank">原文链接</a></span>{/if}
        </div>
        <div class="article-content">{$content}</div>
    </div>
</div>

<div class="container">
    {if $content_page}
    <div class="pagination">
        {loop $content_page $t=>$u}
        <a{if $page!=$t} href="{$u}"{else} style="background-color: #c00;"{/if}>{$t}</a>
        {/loop}
    </div>
    {/if}
    {$pagination}
</div>

<div class="container">
    <div class="article-prev-next">
        {if $prev_page}<p class="article-prev">上一篇：<a href="{$prev_page['url']}">{$prev_page['title']}</a></p>{/if}
        {if $next_page}<p class="article-next">下一篇：<a href="{$next_page['url']}">{$next_page['title']}</a></p>{/if}
    </div>
</div>

<div class="container">
    <div class="panel-group" id="comments" role="tablist">
        <div class="panel panel-default">
            <div class="panel-heading" role="tab">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#comments" href="#comments-input">提交评论</a>
                </h4>
            </div>
            <div id="comments-input" class="panel-collapse collapse in" role="tabpanel">
                <div class="panel-body">
                    <form class="" action="{function.url('index/form', array('modelid'=>4, 'cid'=>$id))}" method="post">
                        <div class="row">
                            <div class="col-md-5">
                                <div class="form-group">
                                    <label for="data_nickname">您的昵称</label>
                                    <input id="data_nickname" name="data[nickname]" type="text" class="form-control" placeholder="您的昵称" />
                                </div>
                                <div class="form-group">
                                    <label for="data_email">您的邮箱</label>
                                    <input id="data_email" name="data[email]" type="text" class="form-control" placeholder="您的邮箱" />
                                </div>
                                <div class="form-group">
                                    <label for="data_url">您的网址</label>
                                    <input id="data_url" name="data[url]" type="text" class="form-control" placeholder="您的网址" />
                                </div>
                            </div>
                            <div class="col-md-7">
                                <div class="form-group">
                                    <label for="data_content">评论内容</label>
                                    <textarea id="data_content" class="form-control" name="data[content]" rows="6" placeholder="评论内容"></textarea>
                                </div>
                                <div class="form-group">
                                    <button type="submit" class="btn btn-success" name="submit">提交</button>
                                </div>
                            </div>
                        </div>
                        <br />
                    </form>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading" role="tab">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#comments" href="#comments-list">评论列表</a>
                </h4>
            </div>
            <div id="comments-list" class="panel-collapse collapse in" role="tabpanel">
                <div class="panel-body">
                    {list table=form_comment cid=$id num=10}
                    <div class="media">
                        <div class="media-left">
                            <a href="{$vdata['url']}">
                                <img class="media-object img-thumbnail" src="https://s.gravatar.com/avatar/{function.md5($vdata['email'])}.png?s=64" alt="{$vdata['nickname']}">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">{$vdata['nickname']}</h4>
                            <div>{$vdata['email']}</div>
                            <div>{$vdata['url']}</div>
                            <div>{$vdata['content']}</div>
                        </div>
                    </div>
                    {/list}
                </div>
            </div>
        </div>
    </div>
</div>

{template footer.html}